package handler

import (
	"github.com/gin-gonic/gin"
	"choujiang/common/utils"
	"choujiang/common/consts"
	"choujiang/box_server/service"
)

func ExchangeScene(c *gin.Context) {
	form := c.Request.Form
	scene := form.Get("scene")
	if scene == "" {
		utils.Error(consts.ErrInvalidParams, c)
		return
	}
	channel, errType := service.ExchangeScene(scene)
	if errType != nil {
		utils.Error(errType, c)
		return
	}
	utils.JSON(channel, c)
}
